package vn.fsoft.gst.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;

/**
 * This class is a entity for supportingmaterial table, Mapping Hibernate
 * @author TienNM
 *
 */
@Repository
@Entity
@Table(name = "supportingmaterial")
public class SupportingMaterial {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "SupportingMaterialID")
	private int supportingMaterialID;

	@Column(name = "URL")
	private String URL;

	@Column(name = "Description")
	private String description;

	@Column(name = "Type")
	private String type;

	@Column(name = "AddedDate")
	@DateTimeFormat(pattern = "dd/MM/yyyy")
	private Date addedDate;

	@Column(name = "IsActive")
	private boolean active;

	@ManyToOne
	@JoinColumn(name = "UserID")
	private User user;

	@ManyToOne
	@JoinColumn(name = "OrgID")
	private Organisation organisation;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public int getSupportingMaterialID() {
		return supportingMaterialID;
	}

	public void setSupportingMaterialID(int supportingMaterialID) {
		this.supportingMaterialID = supportingMaterialID;
	}

	public String getURL() {
		return URL;
	}

	public void setURL(String uRL) {
		URL = uRL;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getAddedDate() {
		return addedDate;
	}

	public void setAddedDate(Date addedDate) {
		this.addedDate = addedDate;
	}

	public boolean getIsActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public boolean isActive() {
		return active;
	}

	public Organisation getOrganisation() {
		return organisation;
	}

	public void setOrganisation(Organisation organisation) {
		this.organisation = organisation;
	}

}
